<include file="Public:head" />
<link href="__APP__/Application/{$Think.MODULE_NAME}/Public/css/login.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/js/jquery/validate.js"></script>
<script type="text/javascript">
    $(function() {
        $("#form").validate({
            errorPlacement: function(error, element) {
                var error_td = element.parent('li');
                error_td.find('label.error').hide();
                error_td.append(error);
            }
            ,
            submitHandler:function(form){
               $.post("{:U('Ajax/checkLoginPwd')}",{
            name:$("#name").val(),
            pwd:$("#pwd").val()
        },function(data){
            if(data == -1){
                alert("用户名或密码错误");
            }else{
                document.form.submit();
            }
        })
            },
            
            rules: {
                name: {
                    required: true
                },
                pwd: {
                    required: true
                    
                },
                    
            },
            messages: {
                name: {
                    required: "用户名不能为空"
                },
                pwd: {
                    required: "密码不能为空"
                }
            }
        });
    });
</script>
<div id="wrap">
    <!--end of header-->
    <div id="container" class="clearfix">
        <form name="form" method="POST" action="__URL__/login" id='form' > 
            <div class="login shadow">
                <div class="login-title">
                    <h3>用户登录</h3>
                </div>
                <ul>
                    <li class="login_mail">
                        <label for="Account">帐号：</label>
                        <input type="text" id="name" name="name" maxlength="30" 
                               placeholder="{$searchWord}"  class="inputSearch" type="text"
                               autocomplete="off" />
                    </li>
                    <li class="login_password">
                        <label for="Password">密码：</label>
                        <input id="pwd" name="pwd" tabindex="2" type="password"   autocomplete="off"/>
                    </li>
                    <li class="login_btn">
                        <label>&nbsp;</label>
                        <input type="checkbox" autocomplete="off" name="is_auto" value="1"/> 
                        <span  class="autoLogin">下次自动登录</span>
                    </li>
                    <li class="login_btn">
                        <input type="submit" id="LoginIn" value="登录"  />
                        <p>
                            <a href="{:U('Pwd/find')}">忘记密码？</a></p>
                    </li>
                </ul>
                <div class="member">
                    <span>还没有{$config.title}帐号？</span><a href="{:U('Reg/index')}" class="loginBtn">注册</a>
                    <div class="othLogin">
                        <p>使用合作网站帐号登录{$config.title}：</p>
                        <foreach name="threeLogin" item="row">
                            <a href="{:U('Index/login',array('type'=>$row['code']))}">
                                <img src="__APP__/{$row.logo}" alt="{$row.name}" />
                            </a> 
                        </foreach>
                    </div>
                    <!--end of othLogin-->
                </div>
            </div>
        </form>
        <!--end of login-->
    </div>
    <include file="Public:foot" />